#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>

int uninit;
int init = 100;

int main(int argc,char* argv[],char* env[]){
  printf("代码区所在的地址是：%p\n",main);
  printf("初始化变量所在的地址是：%p\n",&init);
  printf("未初始化变量所在的地址是：%p\n",&uninit);
  char *heap =(char*)malloc(20);
  char *heap1 =(char*)malloc(20);
  char *heap2 =(char*)malloc(20);
  char *heap3 =(char*)malloc(20);
  char *heap4 =(char*)malloc(20);

  static int a = 1;

  printf("堆区所在的地址是：%p\n",heap);
  printf("堆区所在的地址是：%p\n",heap1);
  printf("堆区所在的地址是：%p\n",heap2);
  printf("堆区所在的地址是：%p\n",heap3);
  printf("堆区所在的地址是：%p\n",heap4);

  printf("栈区所在的地址是：%p\n",&heap);
  printf("栈区所在的地址是：%p\n",&heap1);
  printf("栈区所在的地址是：%p\n",&heap2);
  printf("栈区所在的地址是：%p\n",&heap3);
  printf("栈区所在的地址是：%p\n",&heap4);

  printf("a的地址是：%p\n",&a);

  for(int i=0;argv[i];i++){
    printf("arg[%d] = %p\n",i,argv[i]);
   // printf("&arg[%d] = %p\n",i,argv+i);
   // printf("------------------------------\n");
  }

  for(int i=0;env[i];i++){
    printf("env[%d] = %p\n",i,env[i]);
   // printf("&env[%d] = %p\n",i,env+i);
   // printf("------------------------------\n");
  }

//  for(int i=0;env[i];i++){
//    printf("env[%d]====%s\n",i,env[i]);
//    printf("----------------\n");
//  
//  }
  printf("########################################\n");
  for(int i=0;argv[i];i++){
    printf("argv[%d]===%s\n",i,argv[i]);
    printf("------------------\n");
  }
  return 0;
}
